package com.koala.association;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

import com.association.R;

public class AboutActivity extends Activity implements OnClickListener{

	private TextView tv_callUs ;
	private TextView tv_goNet ;
	private ImageButton ib_back ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about);

		initViews();
		setViewListener();

	}

	private void setViewListener() {
		// TODO Auto-generated method stub
		tv_callUs.setOnClickListener(this);
		tv_goNet.setOnClickListener(this);
		ib_back.setOnClickListener(this);
	}

	private void initViews() {
		// TODO Auto-generated method stub
		tv_callUs = (TextView)findViewById(R.id.tv_callUs);
		tv_goNet=(TextView)findViewById(R.id.tv_goNet);
		ib_back = (ImageButton)findViewById(R.id.ib_back);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.tv_callUs :
			Uri phoneUri =Uri.parse("tel:"+getResources().getString(R.string.lvzePhone)) ;
			System.out.println(phoneUri);
			Intent intent=new Intent(Intent.ACTION_DIAL ,phoneUri );
			startActivity(intent);
			break;
		case R.id.tv_goNet:
			Uri netUri = Uri.parse(getResources().getString(R.string.lvzeUrl));
			System.out.println(netUri);
			Intent netIntent = new Intent(Intent.ACTION_VIEW , netUri) ;
			startActivity(netIntent);
			break;
		case R.id.ib_back:
			finish();
			break;


		default:
			break;
		}
	}

}
